@ECHO OFF

REM   This script assumes that the file is named clean.bat
REM   Place this file inside root folder for your job
REM and run it.

REM	Inform the user about current location
ECHO	%CD%

REM Iterate in folders
FOR /F "DELIMS==" %%d in ('DIR "%CD%" /AD /B') DO ( 

  REM Avoid SubVrrsioN folders
  REM To avoid other names, add new lines here
  IF "%%d" neq ".svn" (
    
	
    REM Replicate ourselves
    COPY	"clean.bat" "%CD%\%%d\clean.bat" /y
	
    REM Enter target folder
    PUSHD	"%CD%\%%d"
	
	DEL		/Q /F "Makefile*"
	DEL		/Q /F "*.user*"
	DEL		/Q /F "*.pdb"
	RMDIR	/S /Q debug
	RMDIR	/S /Q release
	
    REM Execute a new instance
    CALL	"clean.bat"
	
    REM Came back to this folder
    POPD
	
    REM And delete temporary instance
    DEL		"%CD%\%%d\clean.bat"
	
  REM ENDIF "%%d" neq ".svn" (
  )
  
REM ENDFOR /F "DELIMS==" %%d in ('DIR "%CD%" /AD /B') DO ( 
)
 